import inspect

class Access():
    def clone(self):
        accessClass = self.__class__
        newIns = accessClass()        
        for attrName in dir(newIns):         
            attr = getattr(self, attrName)
            if inspect.ismethod(attr):
                continue
            if isinstance(attr, Access):
                setattr(newIns, attrName, attr.clone())
                continue
            setattr(newIns, attrName, attr)
        return newIns
        

class RWAccess(Access):
    def __init__(self, read = False, write = False):
        self.read = read
        self.write = write
        
class SeekAccess(Access):
    def __init__(self, seekable = False, seekForward = False, seekBackward = False):
        self.seekable = seekable
        self.seekForward = seekForward
        self.seekBackward = seekBackward
        
class IOAccess(Access):       
    def __init__(self, rw = None, seek = None):
        if rw:
            self.rw = rw.clone()
        else:
            self.rw = RWAccess()
        if seek:
            self.seek = seek.clone()
        else:
            self.seek = SeekAccess()

